package cycles.util.date;

public class CNElement {
	private CNElement(int id, String cntext, CNElement produce,
			CNElement destroy) {
		this.id = id;
		this.cntext = cntext;
		this.produceEle = produce;
		this.destroyEle = destroy;
	}

	private int id;
	private String cntext;
	private CNElement produceEle;
	private CNElement destroyEle;

	public int getId() {
		return id;
	}

	public String getCntext() {
		return cntext;
	}

	public CNElement getProduceEle() {
		return produceEle;
	}

	public CNElement getDestroyEle() {
		return destroyEle;
	}

	public static final int METAL = 1;
	public static final int WOOD = 2;
	public static final int WATER = 3;
	public static final int FIRE = 4;
	public static final int EARTH = 5;

	public static final CNElement[] eles = { null,
			new CNElement(1, "金", null, null),
			new CNElement(2, "木", null, null),
			new CNElement(3, "水", null, null),
			new CNElement(4, "火", null, null),
			new CNElement(5, "土", null, null) };
	static {
		eles[METAL].produceEle = eles[WATER];
		eles[METAL].destroyEle = eles[WOOD];

		eles[WOOD].produceEle = eles[FIRE];
		eles[WOOD].destroyEle = eles[EARTH];

		eles[WATER].produceEle = eles[WOOD];
		eles[WATER].destroyEle = eles[FIRE];

		eles[FIRE].produceEle = eles[EARTH];
		eles[FIRE].destroyEle = eles[METAL];

		eles[EARTH].produceEle = eles[METAL];
		eles[EARTH].destroyEle = eles[WATER];

		for (CNElement ele : eles) {
			if (ele != null) {
				System.out.println(ele.getCntext() + "生"
						+ ele.getProduceEle().getCntext());
				System.out.println(ele.getCntext() + "克"
						+ ele.getDestroyEle().getCntext());

			}
		}
	}

	public static CNElement getEle(int eleId) {
		if (eleId < 1 || eleId > 5) {
			return null;
		}
		return eles[eleId];
	}

	public static void main(String[] args) {
		System.out.println(1);
	}

}
